<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>多tab报表</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/icon.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/ainit.css" type="text/css"></link>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.1.3.1.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.json-2.4.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/model/dataList/element.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/model/dataList/joinElement.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/model/js/jquery.ainit-1.1.0.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/model/js/model.js"></script> 
    <script type="text/javascript" src="${pageContext.request.contextPath}/model/multiReport/mulReport.js"></script> 

    <script type="text/javascript">
		$(function(){
			var ch = document.documentElement.clientHeight;
			var cw = document.documentElement.clientWidth;
			//alert(cw+"===="+ch)1740====828 
			$("div[id=${m.dataStore.prefix}_mul_QUERY]").width((1730/1740)*cw);
			$("div[id=${m.dataStore.prefix}_mul_QUERY]").height((795/828)*ch);
			
			//$("div[id=common_config]").height((120/700)*ch);
			$("div[id=${m.funcId}_multabs]").width((1700/1740)*cw);
			$("div[id=${m.funcId}_multabs]").height((650/828)*ch);
			$("div[id=${m.dataStore.prefix}_config]").height((650/828)*ch);
			
			$("div[id$=_DATALIST]").width((1700/1750)*cw);
			$("div[id$=_DATALIST]").height((550/828)*ch);
			
			$("div[realId$=_congfigVal]").width((1700/1750)*cw);
			var index=0;
			var mObjs=new Array();
			var dsIds="${m.funcId}"; //获取一对多的dsId
			//多tab标签上面的通用的常用查询条件 和多条件查询的封装
			var obj={"dsId":dsIds,"divName":"${m.dataStore.prefix}_QUERYCLN;commConfig","type":"3;6"};
			mObjs[index]=obj;
			//多tab 标签中，每个tab 标签 列表界面的封装
			$("div[realdsid][prefix]").each(function(){
				index++;
				mObjs[index]={"dsId":$(this).attr("realdsid"),"divName":$(this).attr("prefix")+"_DATALIST;"+$(this).attr("prefix")+"_commUse","type":'9;6',"prefix":$(this).attr("prefix")};
			});
			var mulModelObj={};
			//初始化多tab报表标签
			mulModelObj={"mObjs":mObjs,"funcId":dsIds,"dsIds":dsIds,"prefix":"${m.dataStore.prefix}"};
			initRepQuery(mulModelObj);
		});
	</script>
</head>
	<body >
		<div id="${m.dataStore.prefix}_mul_QUERY" style="overflow-y:auto;overflow-x:hidden;">
			<!-- 公用的查询条件和按钮 table-layout:fixed;-->
			<div id="common_config" style="width:98%;">
				<!-- 常用条件查询 -->  
				<div style="float:left;width: 66%;overflow-x:hidden;overflow-y:auto;height: 90%;margin-top: 3px;margin-bottom:5px">
					<style>
						.name_tdQ {
							width: 77px !important;
						}
					</style>
					<table class='tableBord' id="commConfig"  style="float: left;"></table>
				</div>
				<!--显示多条件查询的checkbox -->
				<div style='width:7%;height:75%;float:left;margin-top:20px;text-align:left;'>
					<input type='checkbox'  id='queryCB'	onclick="showQuery(this,'${m.funcId}_multabs','${m.dataStore.prefix}_config',2)" />
					<span style="cursor: pointer;" onclick="showQuerySpan(this,'${m.funcId}_multabs','${m.dataStore.prefix}_config',2)">更多条件</span>
				</div>
				<div id='butns' style="width:25%;height:80%;float:right;text-align:left;margin-top:15px;">
					<!-- 公用的按钮 -->
					<c:forEach items="${m.butnList}" var="but">
						<!-- 分组的公用的按钮 -->
						<c:if test="${not empty but.IS_GROUP && but.IS_GROUP =='T' && not empty but.GROUP_ID}">
							<a href="javascript:void(0)" id="mb2"  code='${m.dataStore.prefix}_${but.BUT_CODE}'  plain="false " menu="#${but.GROUP_ID}" class="easyui-menubutton" iconCls="${but.iconCls}" >${but.BUTN_NAME}</a>
								<div id="${but.GROUP_ID}" style="width: 150px;">
									<c:forEach items="${m.butnList}" var="butn">
										<c:if test="${butn.IS_GROUP != 'T' && not empty butn.GROUP_ID && butn.GROUP_ID==but.GROUP_ID}">
											<c:if test="${empty butn.SCRIPT_FUNC}">
									   			<div iconCls="${butn.iconCls}" code='${m.dataStore.prefix}_${butn.BUT_CODE}' pre='${m.dataStore.prefix}' dsid='${m.dataStore.dsId}' >${butn.BUTN_NAME}</div> 
									   		</c:if>
									   		<c:if test="${not empty butn.SCRIPT_FUNC}">
										   		<div onclick="${butn.SCRIPT_FUNC}"  iconCls="${butn.iconCls}" code='${m.dataStore.prefix}_${butn.BUT_CODE}'  pre='${m.dataStore.prefix}' dsid='${m.dataStore.dsId}' >${butn.BUTN_NAME}</div>  
									   		</c:if>
										</c:if>
									</c:forEach>
								</div>
						</c:if>
						<!-- 非分组的公用的按钮-->
						<c:if test="${empty but.GROUP_ID && empty but.IS_GROUP}">  
							<c:if test="${empty but.SCRIPT_FUNC}">
								<a class='easyui-linkbutton' iconCls="${but.iconCls}" code="${m.dataStore.prefix}_${but.BUT_CODE}"   pre='${m.dataStore.prefix}' dsid='${m.dataStore.dsId}'>${but.BUTN_NAME}</a>
							</c:if>
							<c:if test="${not empty but.SCRIPT_FUNC}">
								<a class='easyui-linkbutton'  onclick="${but.SCRIPT_FUNC}"  iconCls="${but.iconCls}" code="${m.dataStore.prefix}_${but.BUT_CODE}"   pre='${m.dataStore.prefix}' dsid='${m.dataStore.dsId}'>${but.BUTN_NAME}</a>
							</c:if>
						</c:if>
					</c:forEach>
					<!-- 个性的按钮 -->
					<c:forEach items="${m.preButnList}" var="but">
						<!-- 分组的个性化的按钮 -->
						<c:if test="${not empty but.IS_GROUP && but.IS_GROUP =='T' && not empty but.GROUP_ID}">
							<a href="javascript:void(0)" id="mb2" plain="false " menu="#${but.GROUP_ID}" class="easyui-menubutton" iconCls="${but.iconCls}" >${but.BUTN_NAME}</a>
								<div id="${but.GROUP_ID}" style="width: 150px;">
									<c:forEach items="${m.preButnList}" var="butn">
										<c:if test="${butn.IS_GROUP != 'T' && not empty butn.GROUP_ID && butn.GROUP_ID==but.GROUP_ID}">
											<c:if test="${empty butn.SCRIPT_FUNC}">
									   			<div iconCls="${butn.iconCls}" code='${mObjs.dataStores.prefix}_${butn.BUT_CODE}' pre='${mObjs.dataStores.prefix}' dsid='${mObjs.dataStores.dsId}' >${butn.BUTN_NAME}</div> 
									   		</c:if>
									   		<c:if test="${not empty butn.SCRIPT_FUNC}">
										   		<div onclick="${butn.SCRIPT_FUNC}" iconCls="${butn.iconCls}" code='${mObjs.dataStores.prefix}_${butn.BUT_CODE}'  pre='${mObjs.dataStores.prefix}' dsid='${mObjs.dataStores.dsId}' >${butn.BUTN_NAME}</div>  
									   		</c:if>
										</c:if>
									</c:forEach>
								</div>
						</c:if>
						<!-- 非分组的个性化的按钮-->
						<c:if test="${empty but.GROUP_ID && empty but.IS_GROUP}">  
							<c:if test="${empty but.SCRIPT_FUNC}">
								<a class='easyui-linkbutton' iconCls="${but.iconCls}" code="${mObjs.dataStores.prefix}_${but.BUT_CODE}"    pre='${mObjs.dataStores.prefix}' dsid='${mObjs.dataStores.dsId}' >${but.BUTN_NAME}</a>
							</c:if>
							<c:if test="${not empty but.SCRIPT_FUNC}">
								<a class='easyui-linkbutton' onclick="${but.SCRIPT_FUNC}"  iconCls="${but.iconCls}" code="${but.BUT_CODE}"   pre='${mObjs.dataStores.prefix}' dsid='${mObjs.dataStores.dsId}' >${but.BUTN_NAME}</a>
							</c:if>
						</c:if>
					</c:forEach>
				</div>
			</div>
			<div id="${m.funcId}_multabs"  dsids="${m.dsIds}" class="easyui-tabs" fit='true' style="min-height:650px;" isMulTabs="true">
				<c:forEach items="${m.mObjs}"  varStatus="i" var="mObjs" >
					<div title="${mObjs.dataStores.panelTitle}" code="${mObjs.dataStores.prefix}_repTab" >
						<div style="padding-top:3px;">
							<c:if test="${mObjs.dataStores.dsId == 'ds_xsxt_zk_analysis'||mObjs.dataStores.dsId == 'ds_fx_chargemx_analysis'}">
								<div id="commGroupConfig" style="clear: both;margin-bottom:2px;margin-left:10px">
									<span>
										<input colnName="GROUPAll"     dsId="${mObjs.dataStores.dsId}"         prefix="${mObjs.dataStores.prefix}"  checked="checked"     onclick="check(this,1);" style="cursor: pointer;" name="grouptype"   type="radio"/>
										<span colnName="GROUPAll"      dsId="${mObjs.dataStores.dsId}"         prefix="${mObjs.dataStores.prefix}"  onclick="check(this,2);" style="padding-left: 2px;cursor: pointer;">全部</span> &nbsp;&nbsp;&nbsp;
										<input colnName="GROUPYEAR"     dsId="${mObjs.dataStores.dsId}_year"   prefix="${mObjs.dataStores.prefix}_y"  onclick="check(this,1);" style="cursor: pointer;" name="grouptype"   type="radio"/>
										<span colnName="GROUPYEAR"      dsId="${mObjs.dataStores.dsId}_year"   prefix="${mObjs.dataStores.prefix}_y"   onclick="check(this,2);" style="padding-left: 2px;cursor: pointer;">年</span> &nbsp;&nbsp;&nbsp;
										<input colnName="GROUPMONTH"    dsId="${mObjs.dataStores.dsId}_month"  prefix="${mObjs.dataStores.prefix}_m"   style="cursor: pointer;" onclick="check(this,1);" name="grouptype"  type="radio"/>
										<span colnName="GROUPMONTH"     dsId="${mObjs.dataStores.dsId}_month"  prefix="${mObjs.dataStores.prefix}_m"  onclick="check(this,2);" style="padding-left: 2px;cursor: pointer;">月</span>&nbsp;&nbsp;&nbsp;
										<input colnName="GROUPWEEK"     dsId="${mObjs.dataStores.dsId}_week"   prefix="${mObjs.dataStores.prefix}_w"  style="cursor: pointer;" onclick="check(this,1);" name="grouptype"  type="radio"/>
										<span colnName="GROUPWEEK"      dsId="${mObjs.dataStores.dsId}_week"   prefix="${mObjs.dataStores.prefix}_w"  onclick="check(this,2);"   style="padding-left: 2px;cursor: pointer;">周</span>&nbsp;&nbsp;&nbsp;
										<input colnName="GROUPDAY"      dsId="${mObjs.dataStores.dsId}_day"    prefix="${mObjs.dataStores.prefix}_d"  style="cursor: pointer;" onclick="check(this,1);" name="grouptype"  type="radio"/>
										<span colnName="GROUPDAY"       dsId="${mObjs.dataStores.dsId}_day"    prefix="${mObjs.dataStores.prefix}_d"  onclick="check(this,2);"   style="padding-left: 2px;cursor: pointer;">日</span>
									</span>
								</div>
							</c:if>
							<!-- 1.2 生成界面的datagrid -->
							<div id="${mObjs.dataStores.prefix}_DATALIST"   realdsid="${mObjs.dataStores.dsId}"  prefix="${mObjs.dataStores.prefix}" ></div>
							<div realId='${m.dataStore.prefix}_congfigVal'  style="border:1px solid #99BBE8;font-size:14px;color: green;height: 30px;margin-top:5px;margin-left: 2px"></div>
						</div>
					</div>
				</c:forEach>
			</div>
			<!-- 1.3 多条件查询界面 -->
			<div id="${m.dataStore.prefix}_config"  style="display:none;padding: 20px;">  
		    	<!-- 查询条件 	-->
				<table class='tableBord'  id="${m.dataStore.prefix}_QUERYCLN"></table>
    		</div>  	
		</div>
		<input type="hidden" id="${m.dataStore.prefix}_jsUrl" value="${m.dataStore.urlJs}"/>
		<input type="hidden" id="${m.dataStore.prefix}_ainitFunc" value="${m.ainitFunc}"/>
	</body>
</html>
	